import appContainer from './container/app';

const containers = {
    app: appContainer
};


const createContainer = function(options) {
    options = options || {};
    if(typeof options !== 'object') {
        options = {name: String(options)};
    }

    let container = containers[options.name];
    if(!container) {
        container = appContainer;
    }
    
    return function(view) {
        if(!view) {
            return null;
        }
        return container(view, options);
    };
};

export default createContainer;
